package cn.com.blueInfo.bpm.person.convert;

import cn.com.blueInfo.bpm.common.convert.BaseConvert;
import cn.com.blueInfo.bpm.person.entity.UserIdentity;
import cn.com.blueInfo.bpm.person.request.UserIdentityDTO;
import cn.com.blueInfo.bpm.person.response.UserIdentityVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 员工身份信息表 对象转换
 * @author suxch
 * @since 2025-08-31 16:18:02
 */
@Mapper(componentModel = "spring")
public interface UserIdentityConvert
        extends BaseConvert<UserIdentity, UserIdentityDTO, UserIdentityVO> {

    UserIdentity dtoToEntity(UserIdentityDTO dto);

    UserIdentity dtoToEntity(UserIdentityDTO.UpdatePartialDTO dto);

    @Mapping(source = "status", target = "status", qualifiedByName = "enumToDesc")
    @Mapping(source = "deleted", target = "deleted", qualifiedByName = "enumToDesc")
    @Mapping(source = "primaryStatus", target = "primaryStatus", qualifiedByName = "enumToDesc")
    @Mapping(source = "identityStatus", target = "identityStatus", qualifiedByName = "enumToDesc")
    @Mapping(source = "primaryOrgFlag", target = "primaryOrgFlag", qualifiedByName = "enumToDesc")
    UserIdentityVO entityToVO(UserIdentity entity);

}